//
//  SearchKeyModel.swift
//  SunxianhuaTestApp
//
//  Created by abc on 2021/10/12.
//

import Foundation
import HandyJSON

class SearchKeyListModel: HandyJSON {
    required init() {
    }
    var searchKeyModelArray :[SearchKeyModel] = []
    
    
    func handleData(){
        
        let array = self.searchKeyModelArray.map { item ->SearchKeyModel  in
            item.getWidth()
            return item
        }
        self.searchKeyModelArray = array
    }
}


class SearchKeyModel: HandyJSON {
    required init() {
    }
    var key :String!
    
    var width :CGFloat = 0.0
    init(key :String) {
        self.key = key
        
    }
    
    func getWidth(){
        self.width =  key.getLabHeigh(font: UIFont.systemFont(ofSize: 14), width: 200.0).width + 40.0
    }
    

    
}
